#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define ull unsigned long long
#define i128 __int128
#define mem(x) memset(x,0,sizeof(x))
#define endl "\n"
#define printYes cout << "Yes\n"
#define printYES cout << "YES\n"
#define printNo cout << "No\n"
#define printNO cout << "NO\n"
#define lowbit(x) ((x)&(-(x)))
#define pb push_back
#define mkp make_pair
#define pii pair<int,int>
#define fi first
#define se second
#define SZ(x) ((int)(x).size())
#define rep(i,j,k) for (int i=(j);i<=(k);i++)
#define per(i,j,k) for (int i=(j);i>=(k);i--)
#define pcnt(x) __builtin_popcount(x)
mt19937 rnd(time(0));
template<class T>void chkmin(T&x,T y){x=min(x,y);}
template<class T>void chkmax(T&x,T y){x=max(x,y);}

const ll inf=1000000000000000000; 
//const ll inf=1000000000;
//const ll mod=998244353;
const ll mod=1000000007;

const int N=105;
int n,m; 
char a[N];
ll ans;
bool _st;

namespace workA
{
	ll dp[N][N],g[N][N];
	void work()
	{
		rep(i,1,n+1) dp[i][i-1]=1;
		rep(l,1,n)
		{
			rep(i,1,n-l+1)
			{
				int j=i+l-1;
				if (a[i]!=')'&&a[j]!='(') g[i][j]=dp[i+1][j-1];
				else g[i][j]=0;
				rep(k,i,j)
				{
					(dp[i][j]+=g[i][k]*dp[k+1][j])%=mod;
				}
			}
		}
		(ans+=dp[1][n])%=mod;
	}
}
namespace workB
{
	int f[N][N][N],g[N][N][N];
	int dp[N][N][N*2],w[N][N*2][2];
	void solve(int L)
	{
		rep(i,L-1,n) rep(j,0,n) rep(k,-n,n) dp[i][j][k+N]=0;
		dp[L-1][0][N]=1;
		rep(i,L,n) 
		{
			rep(j,0,n) rep(k,-n,n) w[j][k+N][0]=0,w[j][k+N][1]=0;
			rep(j,0,i-L) rep(k,-(i-L),i-L) for (int x:{-1,1})
			{
				if (dp[i-1][j][k+N]==0) continue;
				if (a[i]==')'&&x==1) continue;
				if (a[i]=='('&&x==-1) continue;
				if (i==L&&x==1) continue;
				(dp[i][max(j,k+x)][k+x+N]+=dp[i-1][j][k+N])%=mod;
				(w[max(j,k+x)][k+x+N][(x+1)/2]+=dp[i-1][j][k+N])%=mod;
			}
			rep(p,0,i+1-L) rep(h,-(i+1-L),p)
			{
				int X=(p+1)/2,Y=(p-h+1)/2;
				ll res=1ll*w[p][h+N][1]*f[L-1][X][0]%mod*g[i+1][Y][0]%mod;
				(ans+=res)%=mod;
			}
		}
	}
	void work()
	{
		f[0][0][0]=1;
		rep(i,1,n) rep(j,0,i-1) rep(k,0,i-1)
		{
			for (int x:{-1,1})
			{
				if (a[i]==')'&&x==1) continue;
				if (a[i]=='('&&x==-1) continue;
				if (k+x<0) continue;
				(f[i][max(j,k+x)][k+x]+=f[i-1][j][k])%=mod;
			}
		}
		rep(i,0,n+1) rep(k,0,n) per(j,n,0) (f[i][j][k]+=f[i][j+1][k])%=mod;
		g[n+1][0][0]=1;
		per(i,n,1) rep(j,0,n-i) rep(k,0,n-i)
		{
			for (int x:{-1,1})
			{
				if (a[i]=='('&&x==1) continue;
				if (a[i]==')'&&x==-1) continue;
				if (k+x<0) continue;
				(g[i][max(j,k+x)][k+x]+=g[i+1][j][k])%=mod;
			}
		}
		rep(i,0,n+1) rep(k,0,n) per(j,n,0) (g[i][j][k]+=g[i][j+1][k])%=mod;
		rep(i,1,n) solve(i);
	}
}
namespace workC
{
	int f[N][N],F[N][N][2],g[N][N][N];
	int dp[N][N][N],w[N][N][2];
	void solve(int L)
	{
		rep(i,L-1,n) rep(j,0,n) rep(k,0,n) dp[i][j][k]=0;
		dp[L-1][0][0]=1;
		rep(i,L,n) 
		{
			rep(j,0,n) rep(k,0,n) w[j][k][0]=0,w[j][k][1]=0;
			rep(j,0,i-L) rep(k,0,i-L) for (int x:{-1,1})
			{
				if (a[i]==')'&&x==1) continue;
				if (a[i]=='('&&x==-1) continue;
				if (k+x>0) 
				{
					(dp[i][max(j,k+x)][k+x]+=dp[i-1][j][k])%=mod;
					(w[max(j,k+x)][k+x][(x+1)/2]+=dp[i-1][j][k])%=mod;	
				}
			}
			rep(j,1,n) rep(k,0,n) (w[j][k][1]+=w[j-1][k][1])%=mod;
			rep(x,0,L) rep(h,0,(i+1-L))
			{
				int H=x+h;
				if (H%2) continue;
				int y=-(H-2*x)/2;
				if (y<0) continue;
				{
					int mid=(H+2*y)/2;
					if (x!=mid) continue;
					ll res=1ll*w[x][h][1]*g[i+1][y][0]%mod*f[L-1][x]%mod;
					if (mid<H&&res) 
					{
						(ans+=res)%=mod;
					}
				}
			}
		}
	}
	void work()
	{
		mem(f),mem(g),mem(F);
		f[0][0]=1;
		rep(i,1,n) rep(k,0,i-1)
		{
			for (int x:{-1,1})
			{
				if (a[i]==')'&&x==1) continue;
				if (a[i]=='('&&x==-1) continue;
				if (k+x<0) continue;
				(f[i][k+x]+=f[i-1][k])%=mod;
				(F[i][k+x][(x==1)]+=f[i-1][k])%=mod;
			}
		}
		g[n+1][0][0]=1;
		per(i,n,1) rep(j,0,n-i) rep(k,0,n-i)
		{
			for (int x:{-1,1})
			{
				if (a[i]=='('&&x==1) continue;
				if (a[i]==')'&&x==-1) continue;
				if (k+x<0) continue;
				(g[i][max(j,k+x)][k+x]+=g[i+1][j][k])%=mod;
			}
		}
		rep(i,1,n)
		{
			rep(H,0,n) rep(y,0,n)
			{
				if (H%2) continue;
				int mid=(H+2*y)/2;
				ll res=0;
				if (mid>=H) 
				{
					res=1ll*g[i+1][y][0]*F[i][H][1]%mod;
					(ans+=res)%=mod;
				}
			}
		}
		rep(i,1,n) solve(i);
	}
}
void RF()
{
	reverse(a+1,a+n+1);
	rep(i,1,n) a[i]^=')'^'(';
}

bool _ed;

int main()
{
	freopen("bracket.in","r",stdin);
	freopen("bracket.out","w",stdout);
	ios_base::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cin >> n;
	rep(i,1,n) cin >> a[i];
	if (n%2)
	{
		cout << 0;
		return 0;
	}
	workA::work();
	workB::work();
	workC::work();
	RF();
	workC::work();
	cout << ans;
	return 0;
}
